package LogicTest;

import java.util.ArrayList;

import junit.framework.Assert;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import Logic.AdminLogic.AdminController;
import Logic.AdminLogic.AdminLogicInterface;
import Po.Manager;
import Po.Message;
import Po.Result;

public class AdminLogicTest {

	AdminLogicInterface test;

	@Before
	public void setUp() throws Exception {
		test = new AdminController();
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public final void testGetSaleManagers() {
		ArrayList<Manager> l = test.getSaleManagers();
		Assert.assertTrue(l.size() == 1);
		Assert.assertTrue(l.get(0).name.equals(""));
	}
	@Test
	public final void testGetGeneralManagers() {
		ArrayList<Manager> l = test.getGeneralManagers();
		Assert.assertTrue(l.size() == 1);
		Assert.assertTrue(l.get(0).name.equals(""));
	}

	@Test
	public final void testAddSaleManager() {
		Message m = test.addSaleManager(new Manager("", ""));
		Assert.assertTrue(m.reason.equals(""));
		Assert.assertTrue(m.result == Result.Success);
	}

	@Test
	public final void testAddGeneralManager() {
		Message m = test.addGeneralManager(new Manager("", ""));
		Assert.assertTrue(m.reason.equals(""));
		Assert.assertTrue(m.result == Result.Success);
	}
	
	@Test
	public final void testModifySaleManager() {
		Message m = test.modifyGeneralManager(new Manager("", ""));
		Assert.assertTrue(m.reason.equals(""));
		Assert.assertTrue(m.result == Result.Success);

	}

	@Test
	public final void testModifyGeneralManager() {
		Message m = test.modifyGeneralManager(new Manager("", ""));
		Assert.assertTrue(m.reason.equals(""));
		Assert.assertTrue(m.result == Result.Success);
	}

	@Test
	public final void testDeleteSaleManager() {
		Message m = this.test.deleteSaleManager(new Manager("", ""));
		Assert.assertTrue(m.reason.equals(""));
		Assert.assertTrue(m.result == Result.Success);
	}

	@Test
	public final void deleteGeneralManager() {
		Message m = test.deleteGeneralManager(new Manager("", ""));
		Assert.assertTrue(m.reason.equals(""));
		Assert.assertTrue(m.result == Result.Success);
	}

	@Test
	public final void TestadminLogin() {
		Message m = test.adminLogin("", "");
		Assert.assertTrue(m.reason.equals(""));
		Assert.assertTrue(m.result == Result.Success);
	}

}
